<template>
  <!--退卡提交页面-->
  <div class="tuikatijiao">
    <div class="search"><input type="text" placeholder="搜索" v-model="content"><img src="../../assets/search.png" alt=""
                                                                                   width="16" @click="goSearch()"></div>
    <ul class="list">
      <li v-for="item in accountGoodsList">
        <ul>
          <li>{{item.mobile}} <span v-if="item.userName!=''">{{item.userName}}</span>
            <span v-else>{{item.accountPhone}}</span>
            <wv-button type="default" :mini="true" class="lookdetail" @click="goAddCheck(item)">核验补录</wv-button>
          </li>
          <li>{{item.goodsName}}
            <wv-button type="default" :mini="true" class="lookdetail" @click="goReduce(item)">核验减少</wv-button>
          </li>
          <li><p>开卡时间：{{item.buyDate}}</p><span>有效</span></li>
          <li>
            <p v-if="item.payType=='PAY_WX'"><img src="../../assets/weixin.png" alt="" width="15">微信</p>
            <p v-if="item.payType=='PAY_UNDERLINE'"><img :src="item.paywayIcon | imgPathFilter" alt="" width="15">{{item.paywayName}}
            </p>
          </li>
        </ul>
      </li>
    </ul>
  </div>
</template>

<script type="text/ecmascript-6">
  import {searchUserVipcard} from '../../../test/unit/http'
  import {Toast} from 'we-vue'

  export default {
    name: '',
    props: {},
    data() {
      return {
        accountGoodsList: [],
        content: '',
        params: {}
      };
    },
    methods: {
      goSearch() {
        let params = {};
        params['queryContent'] = this.content;
        this.getData(params)
      },
      goAddCheck(accountGoods) {
        this.$router.push({name: 'addcheckyanzheng', query: {'accountGoodsId': accountGoods.accountGoodsId}})
      },
      getData(params) {
        searchUserVipcard(params).then(res => {
          console.log(res);
          if (res.code == 100) {
            this.accountGoodsList = res.object;
          } else {
            Toast.text(res.info);
          }
        })
      },
      goReduce(accountGoods) {
        this.$router.push({name: 'addcheckreduce', query: {'accountGoodsId': accountGoods.accountGoodsId}})
      }

    },
    created() {
      this.getData({});
    },
    components: {}
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  .bg {
    background-color: rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 50px;
  }

  .model .modelContent {
    background-color: #fff;
    /*border-radius: 8px;*/
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 100%;
    padding: 15px 0;

    .textarea .weui-cell {
      border: 1px solid #ddd;
      border-radius: 5px;
      background-color: #f8f8f8;
      width: 81%;
      margin: auto;
    }

    li:first-child {
      margin-bottom: 10px;
    }

    .btn {
      text-align: right;
      padding: 15px 15px 0;

      button {
        height: 30px;
        line-height: 30px;
        color: #fff;
        width: 75px;
        border-radius: 25px;
      }

      button:last-child {
        background-color: #ccc;
        border: 1px solid #ccc;
        color: #fff;
      }

      button:first-child {
        background-color: #f98e3c;
        margin-right: 20px;

      }
    }
  }

  .bg1 {
    background-color: rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 50px;
  }

  .model1 .modelContent1 {
    background-color: #fff;
    border-radius: 8px;
    position: fixed;
    left: 50%;
    top: 50%;
    margin-left: -43%;
    margin-top: -111px;
    z-index: 2;
    padding: 40px 10px 20px;
    width: 80%;
    text-align: left;

    img1 {
      position: absolute;
      right: 10px;
      top: 10px
    }

    .btn1 {
      button {
        height: 42px;
        line-height: 42px;
        color: #fff;
        outline: none;
        border: none;
        width: calc(50% - 20px);
        border-radius: 8px;
        margin-top: 25px;
      }

      :last-child {
        background-color: #aaa;

      }

      :first-child {
        background-color: #f98e3c;
        margin-right: 20px;

      }
    }

  }

  .search {
    position: relative;
    width: 95%;
    margin: 10px auto;

    input {
      width: 90%;
      border: 1px solid #eee;
      box-shadow: 0 3px 4px rgba(17, 17, 17, 0.05);
      border-radius: 7px;
      height: 43px;
      line-height: 43px;
      padding: 10px;
      color: #111;
    }

    img {
      position: absolute;
      right: 20px;
      top: 27px;
    }
  }

  .list {
    > li {
      margin: 15px 10px;
      text-align: left;
      border-bottom: 1px solid #ddd;

      li {
        margin-bottom: 10px;
      }

      li:first-child {
        font-size: 16px;
        color: #111;
        font-weight: 700;

        span {
          color: #999;
          margin-left: 10px;
          font-size: 12px;
        }

        button {
          float: right;
          display: inline-block;
        }

        .lookdetail {
          background-color: #fff;
          border: 1px solid #f98e3c;
          color: #f98e3c;
        }
      }

      li:nth-child(2) {
        line-height: 35px;
        height: 35px;
        color: #111;
        font-size: 15px;
        font-weight: 600;

        button {
          float: right;
        }

        .lookdetail {
          background-color: #fff;
          border: 1px solid #f98e3c;
          color: #f98e3c;
        }
      }

      li:nth-child(3), li:last-child {
        font-size: 12px;
        color: #666;
        display: flex;
        text-align: left;

        p {
          flex: 1;
        }

        span {
          font-size: 15px;
          color: #f98e3c;
        }
      }

      li:last-child {
        img {
          vertical-align: middle;
          margin-right: 5px;
        }

        span {
          color: #f98e3c;
          font-size: 15px;
          text-align: right;
        }
      }
    }

    > li:last-child {
      border-bottom: none;
    }

  }
</style>


